package com.hmall.mapper;

import com.hmall.model.MallPaymentVoucher;
import com.hmall.util.MyMapper;
import com.hmall.vo.AccountPeriodPayVo;
import com.hmall.vo.MallPaymentUnpayVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MallPaymentVoucherMapper extends MyMapper<MallPaymentVoucher> {
   public  int  insertPaymentVoucher(@Param("periodPay") AccountPeriodPayVo periodPay, @Param("userId") Integer userId);
   public  int  adoptVoucherByOrderNo(@Param("orderNo") Long orderNo);
   //查询定金
   public  double  selectDeposit(@Param("orderNo") Long orderNo);
   //查询累计还款总额
   public  double  sumPayment(@Param("orderNo") Long orderNo);
   public  double  selectMinUnpayment(@Param("orderNo") Long orderNo);
   public  int selectUnaymentIsPay(@Param("orderNo") Long orderNo);
   public List<MallPaymentVoucher> selectVoucherByOderNo(@Param("orderNo") Long orderNo);
   public int insertUnpaymentVo(@Param("orderNo") Long orderNo, @Param("unpayPayment") Double unpayPayment, @Param("isPay") Integer isPay);
   public int updateUnpaymentVo(@Param("orderNo") Long orderNo, @Param("unpayPayment") Double unpayPayment);
   public int updateUnpaymentIsPay(@Param("orderNo") Long orderNo);
   public MallPaymentUnpayVo selectUnpaymentVo(@Param("orderNo") Long orderNo);

    MallPaymentVoucher selectByOrderNo(@Param("orderNo") Long orderNo, @Param("status") Integer status);

    String selectPaymentVoucher(@Param("orderNo") Long oderNo);

   Integer selectCountByOrderNo(@Param("orderNo") String orderNo);


   Integer selectCountByTransactionNo(@Param("transactionNo") String transactionNo);

    Integer selectHaveExam(@Param("orderNo") Long orderNo);


   MallPaymentVoucher selectByUserIdAndVoucherId(@Param("userId") Integer userId, @Param("voucherId") Integer voucherId);
}